package com.shoukaiseki.xutils.simple;

import com.google.code.microlog4android.Logger;
import com.google.code.microlog4android.LoggerFactory;
import com.google.code.microlog4android.config.PropertyConfigurator;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;


public class Test004Activity extends Activity{
	
	private static final Logger logger = LoggerFactory.getLogger(Test004Activity.class);
	
	int i=0;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		PropertyConfigurator.getConfigurator(this).configure();
		super.onCreate(savedInstanceState);
		final LinearLayout layout2=new LinearLayout(this);  
		final TextView textView = new TextView(this);
		textView.setText("test log");
		layout2.addView(textView);
		final Button button=new Button(this);
		button.setText("按钮1");
		button.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String str="test log按钮按下总计:"+(++i);
				textView.setText(str);
				Log.v("Test004Activity", "VERBOSE"+str);
				Log.d("Test004Activity", "DEBUG"+str);
				Log.i("Test004Activity", "INFO"+str);
				Log.w("Test004Activity", "WARN"+str);
				Log.e("Test004Activity", "ERROR"+str);
				
				logger.debug("DEBUG"+str);
				logger.error("ERROR"+str);
				
			}
		});
		layout2.addView(button);
		setContentView(layout2);
	}	

}
